The present invention relates generally to data communication systems and methods and, more particularly, to data communication systems and methods in which direct memory access (DMA) transfers are performed.
A network interface controller (NIC) is a hardware device that supports the transmission of data between computers. A common source and destination for transmitted data is paged virtual memory within a general-purpose computer system. General-purpose processors incorporate address translation hardware to facilitate virtual page access. Paged virtual memory provides for virtual addresses which are translated or mapped onto physical pages and that a virtual page may be swapped out to disk or removed from main memory and later swapped in from disk to a new physical page location. An operating system can unilaterally perform page swaps of so-called unpinned virtual pages. Thus, application software operating on such network systems typically accesses main memory using address translation hardware that ensures that the correct physical page is accessed, e.g., that the operating system has not initiated a page swap for the page that the software needs to access. Software access pauses during time intervals when needed data is swapped out and resumes by accessing a new physical location when data is swapped in at that location.
Some networking solutions address the downtime associated with software suspension during virtual page swapping by providing for software to copy data from unpinned virtual memory to pinned interface memory. Pinned memory consists of pages that cannot be swapped to disk by the operating system. In such systems, the NIC only accesses pinned interface memory. This simplifies DMA transfers performed by the NIC as data is never swapped during a network operation which, in turn, guarantees that data remains accessible throughout a NIC's DMA data transfer and that the physical address of the data remains constant. However, such solutions require extra overhead in the form of data copying (e.g., from unpinned virtual memory to a pinned system buffer accessible by the NIC) that utilizes important system resources.
Another solution to the issue posed by unpinned virtual memory eliminates the above-described data copying but requires that software invoke an operating system function to pin a user page prior to transmitting data directly from or to that user page. Additionally, the page is later unpinned in order to allow page swapping after network activity is finished. While this eliminates copies to pinned pages, software must now invoke expensive page pinning and page unpinning functions.
Accordingly, it would be desirable to provide mechanisms and methods which enable a NIC to directly access unpinned paged virtual memory without employing, for example, data copying or page pinning/page unpinning functions.